// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import VueRouter from 'vue-router'
import VueResource from 'vue-resource'
// import IndexPage from './pages/index'
// import AlarmPage from './pages/alarm'
// import DeliverPage from './pages/deliver'
// import MonitorPage from './pages/monitor'
// import UserPage from './pages/user'
const IndexPage = r => require.ensure([], () => r(require('./pages/index')), 'chunkname1')
const AlarmPage = r => require.ensure([], () => r(require('./pages/alarm')), 'chunkname2')
const DeliverPage = r => require.ensure([], () => r(require('./pages/deliver')), 'chunkname3')
const MonitorPage = r => require.ensure([], () => r(require('./pages/monitor')), 'chunkname4')
const UserPage = r => require.ensure([], () => r(require('./pages/user')), 'chunkname5')
// ajax
import axios from 'axios'
Vue.prototype.$ajax = axios

import 'jquery'
import 'font-awesome/css/font-awesome.css'

window.jQuery = $
window.$ = $

Vue.config.productionTip = false

Vue.use(VueRouter)
Vue.use(VueResource)

let router = new VueRouter({
	mode: 'history',
	routes: [

		{
			path: '/index',
			component: IndexPage
		},
		{
			path: '/alarm',
			component: AlarmPage
		},
		{
			path: '/deliver',
			component: DeliverPage
		},
		{
			path: '/monitor',
			component: MonitorPage
		},
    {
      path: '/',
      component: IndexPage
    },
		{
			path: '/user',
			component: UserPage
		}
	]
})
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
